@extends('admin::layouts.master')
@section('title')
@endsection
@section('tab')
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
{{--                <div class="layui-card">--}}
{{--                    <div class="layui-card-body ">--}}
{{--                        <form class="layui-form layui-col-space5">--}}
{{--                            <div class="layui-inline layui-show-xs-block">--}}
{{--                                <input type="text" name="key_word" value="{{$arr_search['key_word']}}"  placeholder="请输入用户名" autocomplete="off" class="layui-input ">--}}
{{--                            </div>--}}
{{--                            <div class="layui-inline layui-show-xs-block">--}}
{{--                                <input type="text" name="phone" value="{{$arr_search['phone']}}"  placeholder="请输入手机号" autocomplete="off" class="layui-input ">--}}
{{--                            </div>--}}
{{--                            <div class="layui-inline layui-show-xs-block">--}}
{{--                                <button class="layui-btn layui-btn-normal"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>--}}
{{--                                <a class="layui-btn" onclick="location.reload()">--}}
{{--                                    <i class="layui-icon layui-icon-refresh"></i>--}}
{{--                                </a>--}}
{{--                            </div>--}}
{{--                        </form>--}}
{{--                    </div>--}}

                    <div class="layui-card-body">
                        <button class="layui-btn layui-btn-normal" onclick="xadmin.open('添加保险公司','{{route("admin_insurance_company_add_page")}}',800,600)"><i class="layui-icon"></i>添加保险公司</button>

                    </div>
                    <div class="layui-card-body layui_overflow_y">

                        <table class="layui-table layui-form">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>保险公司名称</th>
                                <th>logo</th>
                                <th>险种</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($arr_data as $key=>$value)
                                <tr>
                                    <td>{{$key+1}}</td>
                                    <td>{{$value["name"]}}</td>
                                    <td>
                                        @if( !empty( $value['logo']['full_src']) )
                                            <img src="{{ $value['logo']['full_src'] }}" style="width: 80px;height: 80px;" class="Look_img" title="点击查看大图" >
                                        @endif
                                    </td>

                                    <td>
                                        @if(!empty($value['insurance_seed']))
                                            <table class="layui-table layui-form">
                                                <thead>
                                                <tr>
                                                    <th>险种</th>
                                                    <th>操作</th>
                                                </tr>
                                                </thead>
                                                <tbody>
                                                @foreach($value['insurance_seed'] as $kk=>$vv)

                                                    <tr>
                                                        <td>{{$vv["name"]}}</td>
                                                        <td class="td-manage">
                                                            <button class="layui-btn layui-btn layui-btn-xs"  onclick="xadmin.open('修改','{{route("admin_insurance_company_seed_edit_page",["id"=>$vv["id"]])}}')" ><i class="layui-icon">&#xe642;</i>修改</button>
                                                            <button class="layui-btn-danger layui-btn layui-btn-xs ajax_member_del" data-href="{{route('admin_insurance_company_seed_delete',['id'=>$vv['id']])}}" data-title="确定删除吗？请谨慎操作" href="javascript:;" ><i class="layui-icon">&#xe640;</i>删除</button>
                                                        </td>
                                                    </tr>

                                                @endforeach
                                                </tbody>
                                            </table>

                                        @else
                                            请添加险种
                                        @endif
                                    </td>
                                    <td class="td-manage">
                                        <button class="layui-btn layui-btn layui-btn-xs"  onclick="xadmin.open('修改','{{route("admin_insurance_company_edit_page",["id"=>$value["id"]])}}')" ><i class="layui-icon">&#xe642;</i>修改</button>
                                        <button class="layui-btn-danger layui-btn layui-btn-xs ajax_member_del" data-href="{{route('admin_insurance_company_delete',['id'=>$value['id']])}}" data-title="确定删除吗？请谨慎操作" href="javascript:;" ><i class="layui-icon">&#xe640;</i>删除</button>
                                        <button class="layui-btn layui-btn-normal" onclick="xadmin.open('添加险种','{{route("admin_insurance_company_seed_add_page",["id"=>$value["id"]])}}',800,600)"><i class="layui-icon"></i>添加险种</button>

                                    </td>
                                </tr>

                            @endforeach

                            </tbody>
                        </table>
                    </div>
                    <div class="layui-card-body ">
                        <div class="page">
                            {{$page_link}}
                        </div>
                        <div id="page"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('tab_js')
    <script>


        layui.use(['form'], function () {
            var form = layui.form;

            //监听指定开关-修改状态
            form.on('switch(change_state)',
                function (obj) {
                    change_state(this);
                });

            //点击图片查看大图
            var bigImgIndex = null;
            $("body").on('click','.Look_img',function(){
                var img_src = $(this).attr('src');
                var img_infor = "<img height='600px' border='0' src='" + img_src + "' />";
                bigImgIndex = layer.open({
                    content:img_infor,
                    type:1,
                    area:['auto'],
                    shadeClose: true,
                    shade:[0.4, '#000000'],
                    title:false,
                    closeBtn:true
                });
            });
        });
    </script>
@endsection




